import { get, put, post, deleted } from '@/api/axios'


// 用户列表
export const getUserList = (params) => get('users', params)

// 修改用户状态

export const getChangeState = (params) => put(`users/${params.uId}/state/${params.type}`)



//添加用户
export const addUser = (params) => post('users', params)


// 查询单个用户 信息 

// 根据id获取用户信息
export const getUserById = params => get(`users/${params}`)

// 编辑用户信息
export const editUser = params => put(`users/${params.id}`, params)

// 删除用户信息
export const deleteUser = params => deleted(`users/${params}`)


// 获取角色列表
export const getRoleList = params => get('roles')

// 分配角色
export const grantUserRole = params => put(`users/${params.id}/role`, { id: params.id, rid: params.rid })




